/*
 ============================================================================
 Name		: MyS60AlarmAppView.h
 Author	  : 
 Copyright   : Your copyright notice
 Description : Declares view class for application.
 ============================================================================
 */

#ifndef __MYS60ALARMAPPVIEW_h__
#define __MYS60ALARMAPPVIEW_h__

// INCLUDES
#include <coecntrl.h>
#include <aknlists.h>    //for list box
#include <eiklbo.h> // MEikListBoxObserver
#include <aknform.h> //for alarm editor

#include "MyS60AlarmForm.h"

// CLASS DECLARATION
class CMyS60AlarmAppView : public CCoeControl, MEikListBoxObserver
	{
public:
	// New methods

	/**
	 * NewL.
	 * Two-phased constructor.
	 * Create a CMyS60AlarmAppView object, which will draw itself to aRect.
	 * @param aRect The rectangle this view will be drawn to.
	 * @return a pointer to the created instance of CMyS60AlarmAppView.
	 */
	static CMyS60AlarmAppView* NewL(const TRect& aRect);

	/**
	 * NewLC.
	 * Two-phased constructor.
	 * Create a CMyS60AlarmAppView object, which will draw itself
	 * to aRect.
	 * @param aRect Rectangle this view will be drawn to.
	 * @return A pointer to the created instance of CMyS60AlarmAppView.
	 */
	static CMyS60AlarmAppView* NewLC(const TRect& aRect);

	/**
	 * ~CMyS60AlarmAppView
	 * Virtual Destructor.
	 */
	virtual ~CMyS60AlarmAppView();

public:
	// Functions from base classes

	/**
	 * From CCoeControl, Draw
	 * Draw this CMyS60AlarmAppView to the screen.
	 * @param aRect the rectangle of this view that needs updating
	 */
	void Draw(const TRect& aRect) const;

	/**
	 * From CoeControl, SizeChanged.
	 * Called by framework when the view size is changed.
	 */
	virtual void SizeChanged();

private:
	// Constructors

	/**
	 * ConstructL
	 * 2nd phase constructor.
	 * Perform the second phase construction of a
	 * CMyS60AlarmAppView object.
	 * @param aRect The rectangle this view will be drawn to.
	 */
	void ConstructL(const TRect& aRect);

	/**
	 * CMyS60AlarmAppView.
	 * C++ default constructor.
	 */
	CMyS60AlarmAppView();

public:
	
	void CreateAlarmList();
	void LoadAlarms();

private:
	
	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
	void HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aListBoxEvent);
	TInt CountComponentControls() const;
	CCoeControl* ComponentControl(TInt aIndex) const;

private:
	
	CAknDoubleTimeStyleListBox* iAlarmList;
	CTextListBoxModel* iAlarmListBoxModel;
	};

#endif // __MYS60ALARMAPPVIEW_h__
// End of File
